#ifndef __ARCH_H__
#define __ARCH_H__

#include "linux/compiler.h"

enum reboot_mode
{
    REBOOT_COLD = 0,
    REBOOT_WARM,
    REBOOT_HARD,
    REBOOT_SOFT,
    REBOOT_GPIO,
};

struct machine_desc
{
    unsigned int nr;              /* architecture number	*/
     char *name;             /* architecture name	*/
    unsigned long atag_offset;    /* tagged list (relative) */
    char **dt_compat; /* array of device tree
                                   * 'compatible' strings	*/

    unsigned int nr_irqs; /* number of IRQs */

#ifdef CONFIG_ZONE_DMA
    phys_addr_t dma_zone_size; /* size of DMA-able area */
#endif

    // enum reboot_mode	reboot_mode;	/* default restart mode	*/
    unsigned l2c_aux_val;  /* L2 cache aux value	*/
    unsigned l2c_aux_mask; /* L2 cache aux mask	*/
    void (*l2c_write_sec)(unsigned long, unsigned);
    //  struct smp_operations	*smp;	/* SMP operations	*/
    int (*smp_init)(void);
    //void (*fixup)(struct tag *, char **);
    void (*dt_fixup)(void);
    long (*pv_fixup)(void);
	void (*init_meminfo)(void);
    void (*reserve)(void); /* reserve mem blocks	*/
    void (*map_io)(void);  /* IO mapping function	*/
    void (*init_early)(void);
    void (*init_irq)(void);
    void (*init_time)(void);
    void (*init_machine)(void);
    void (*init_late)(void);
    void (*restart)(enum reboot_mode,  char *);
};

#define MACHINE_START(_type,_name)			\
static  struct machine_desc __mach_desc_##_type	\
 __used							\
 __attribute__((__section__(".arch.info.init"))) = {	\
	.nr		= MACH_TYPE_##_type,		\
	.name		= _name,

#define MACHINE_END				\
};

#define DT_MACHINE_START(_name, _namestr)		\
static  struct machine_desc __mach_desc_##_name	\
 __used							\
 __attribute__((__section__(".arch.info.init"))) = {	\
	.nr		= ~0,				\
	.name		= _namestr,

extern struct machine_desc *machine_desc;


#endif
